package cn.school.service;

import org.apache.ibatis.session.SqlSession;

import cn.school.dao.SubjectDao;
import cn.school.entity.Subject;
import cn.school.util.MyBatisUtil;

public class Service3 {
	public int add(Subject s) {
		SqlSession session = MyBatisUtil.getSqlsession();
		try {
			SubjectDao subjectDao = session.getMapper(SubjectDao.class);
			return subjectDao.add(s);
		} finally {
			MyBatisUtil.getclose(session);
		}
	}
}
